<template>
    <div>
        <h2>评论页面</h2>
        <p>评论：<input type="text" v-model="comment"></p>
        <button @click="sub()">提价评论</button>
    </div>
</template>

<script>
import axios from "axios"
export default {
    name:"ppll",
    data() {
        return {
            comment:"",
            id:"",
        }
    },
    methods:{
        sub(){
            let formdata = new FormData()
            formdata.append("content",this.comment)
            formdata.append("id",this.$route.params.id)
            formdata.append("username",sessionStorage.getItem("username"))
            axios({
                url:"http://127.0.0.1:8000/app04/com/",
                method:"post",
                data:formdata
            }).then(res=>{
                console.log(res.data)            
            })       
    }
    }

    

}
</script>

<style>

</style>
